package controller;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import tools.UtilMessage;

import java.sql.Connection;

/**
 * @Author 王志康
 * @Date 2021/9/5 17:49
 * @Version 1.0.0
 */
public class MessageController {
    @FXML
    private Label label;

    /**
     * 更改对应窗口的显示文本
     *
     * @param message 待显示文本
     */
    @FXML
    public void setMessage(String message) {
        this.label.setText(message);
    }

    /**
     * 关闭对应消息窗口
     *
     * @param mouseEvent 鼠标事件
     */
    @FXML
    public void closeMessage(MouseEvent mouseEvent) {
        Stage stage = (Stage) label.getScene().getWindow();
        stage.close();
    }
}
